﻿using System.Linq;
using System.Text;

namespace Sample.Models
{
    internal partial class Project 
    {
        public override string ToString()
        {
            var result = new StringBuilder("Project(").AppendLine();
            result.AppendFormat("\tId:{0},", Id).AppendLine();
            result.AppendFormat("\tTitle:{0},", Title).AppendLine();
            result.Append(")").AppendLine();
            return result.ToString();
        }

        public int TotalRemainingEffort
        {
            get { return Tasks.Where(x => !x.IsComplete).Sum(x => x.HoursEffort); }
        }
    }
}
